package br.ufpb.di.ppgi.apresentacao.controllers;

import br.com.caelum.vraptor.Path;
import br.com.caelum.vraptor.Result;
import br.com.caelum.vraptor.Validator;
import br.com.simtecnologia.access.controll.annotation.ControlledResource;
import br.com.simtecnologia.access.controll.role.Roles;
import br.ufpb.di.ppgi.apresentacao.SiteConfiguration;
import br.ufpb.di.ppgi.negocio.ServiceLocator;
import br.ufpb.di.ppgi.negocio.modelo.usuario.UsuarioSessionInfo;

@Path("/admin/processos/")
@ControlledResource
@Roles({"PROFESSOR"})
public class ProcessosRestrictController extends AbstractController {
	
//	private final ServiceLocator serviceLocator;
    private final UsuarioSessionInfo usuarioInfo;
//    private final SiteConfiguration conf;
	

	public ProcessosRestrictController(Result result, Validator validator,
			ServiceLocator services, UsuarioSessionInfo usuarioInfo, SiteConfiguration conf) {
		super(result, validator, services);

		this.usuarioInfo = usuarioInfo;
//		this.serviceLocator = services;
//		this.conf = conf;
	}
	
	@Path("")
	public void index(String msg) {
		result.include("propostas", services.forProposta().listarByUsuarioId(usuarioInfo.getId()));
		result.include("defesas", services.forDefesa().listarByUsuarioId(usuarioInfo.getId()));
		result.include("msg",msg);
	}

}